import java.lang.reflect.Array;

public class Main {
    public static void main(String[] args) {
       int[] nums = new int[]{1,2,3,4,5,6,7};
       int k = 3;
        rotate(nums,k);

        for (int i = 0; i < nums.length; i++) {
            System.out.print(nums[i] + " ");
        }
    }



    public static void rotate(int[] nums, int k) {

        for (int i = 0; i < k; i++) {
            int tem = nums[nums.length - 1];
            for (int j  = nums.length - 1;  j> 0; j--) {
                nums[j] = nums[j-1];
            }
            nums[0] = tem;
        }
    }

}
